package cn.jizi.bshisy.service.impl;

import cn.jizi.bshisy.entity.PayItems;
import cn.jizi.bshisy.mapper.PayItemsMapper;
import cn.jizi.bshisy.service.PayItemsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PayItemsServceImpl implements PayItemsService {
    @Resource
    private PayItemsMapper payItemsMapper;
    //收费
    @Override
    public int getAddPayItems(PayItems payItems) {
        return payItemsMapper.getAddPayItems(payItems);
    }

    //根据收费项目类型，病人姓名查询
    @Override
    public List<PayItems> getPageListPayItems(String pname, String sname, Integer currentPageNo, Integer pageSize) {
        // 计算起始位置
        currentPageNo = (currentPageNo - 1) * pageSize;
        return payItemsMapper.getPageListPayItems(pname, sname, currentPageNo, pageSize);
    }
    @Override
    public int getPageListPayItemsCount(String pname, String sname) {
        return payItemsMapper.getPageListPayItemsCount(pname, sname);
    }
}
